using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace EFDataBase.Models.Mapping
{
    public class ShopingCar_ProMap : EntityTypeConfiguration<ShopingCar_Pro>
    {
        public ShopingCar_ProMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.parent_id)
                .HasMaxLength(50);

            this.Property(t => t.product_name)
                .HasMaxLength(50);

            this.Property(t => t.range)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.deletes)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.Go_online)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.product_type)
                .HasMaxLength(50);

            this.Property(t => t.product_detale)
                .HasMaxLength(550);

            this.Property(t => t.main_img)
                .HasMaxLength(150);

            this.Property(t => t.Stock)
                .IsFixedLength()
                .HasMaxLength(20);

            this.Property(t => t.Sales_volume)
                .IsFixedLength()
                .HasMaxLength(20);

            this.Property(t => t.price)
                .IsFixedLength()
                .HasMaxLength(20);

            this.Property(t => t.id)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.openid)
                .HasMaxLength(50);

            this.Property(t => t.ShoppingCar_deletes)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.childimg)
                .HasMaxLength(150);

            this.Property(t => t.pruduct_id)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("ShopingCar_Pro");
            this.Property(t => t.parent_id).HasColumnName("parent_id");
            this.Property(t => t.product_name).HasColumnName("product_name");
            this.Property(t => t.range).HasColumnName("range");
            this.Property(t => t.deletes).HasColumnName("deletes");
            this.Property(t => t.Go_online).HasColumnName("Go_online");
            this.Property(t => t.Go_onlinetime).HasColumnName("Go_onlinetime");
            this.Property(t => t.createtime).HasColumnName("createtime");
            this.Property(t => t.product_type).HasColumnName("product_type");
            this.Property(t => t.product_detale).HasColumnName("product_detale");
            this.Property(t => t.main_img).HasColumnName("main_img");
            this.Property(t => t.Stock).HasColumnName("Stock");
            this.Property(t => t.Sales_volume).HasColumnName("Sales_volume");
            this.Property(t => t.price).HasColumnName("price");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.openid).HasColumnName("openid");
            this.Property(t => t.ShoppingCar_createtime).HasColumnName("ShoppingCar_createtime");
            this.Property(t => t.ShoppingCar_deletes).HasColumnName("ShoppingCar_deletes");
            this.Property(t => t.childimg).HasColumnName("childimg");
            this.Property(t => t.pruduct_id).HasColumnName("pruduct_id");
        }
    }
}
